package nl.sodeso.cubicex.command.storage;

import java.io.File;
import java.util.Map;

import org.cubictest.selenium.custom.IElementContext;

import com.thoughtworks.selenium.Selenium;

import nl.sodeso.cubicex.CubicExBaseTestCase;

/**
 * Captures a screen shot and saves it to the specified file.
 * 
 * @author y.bittan
 * @since 0.0.4
 */
public class CaptureEntirePageScreenshot extends CubicExBaseTestCase {

	/**
	 * {@inheritDoc}
	 */
	public void executeTest(Map<String, String> arguments,
			IElementContext context, Selenium selenium) throws Exception {
		
		String _filename=getArgFilename();
		String _kwargs=getArgAsString("kwargs");
		selenium.captureEntirePageScreenshot(_filename, _kwargs);
		
		File f=new File(_filename);
		assertTrue(f.exists());

	}
}
